#ifndef LOGINWIDGET_H
#define LOGINWIDGET_H

#include <QWidget>
#include <QPushButton>
#include <QLabel>
#include <QDate>

#include "LoginWindow.h"
#include "LoginQuery.h"
#include "WeightQuery.h"

class LoginWidget : public QWidget
{
    Q_OBJECT

private:

    QPushButton* login;
    QPushButton* logout;
    QPushButton* enter;
    QPushButton* cancel;
    QLabel *name;
    LoginWindow *loginWindow;
    LoginQuery query;
    WeightQuery w_query;






public:

    LoginWidget(QWidget *parent = 0);
    //~LoginWidget() {};


public slots:
    void onLoginButton();
    void onLogoutButton();
    void onCancel();
    void onEnterButton();
    void responseReceived(QString status, QString auth_token);
    void weightResponseReceived(QString status, QDate date, double weight);
    void errorReceived();
    void inDietSystem();
    void getWeight(QString auth_token);
    void addWeight(QString auth_token, double weight);


signals:
     void logoutSignal();
     void onSucsess(QString authToken);
     void onGetWeightSucsess(QDate date, double weight);


};

#endif // LOGINWIDGET_H
